﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace GameForm.Gamelib
{
    public class GameTaskApi : GameApi
    {
        private string _taskName = "";
        public GameTaskApi(Dm.dmsoft dm, string taskName) : base(dm)
        {
            _taskName = taskName;
        }



        public TaskBase GetTask()
        {

            /*
                挖图
                抓鬼
                帮派
                深渊
                运镖
             */
            TaskBase task = null;
            switch (_taskName)
            {
                case "抓鬼":
                    task = new 抓鬼Task();
                    break;
                case "帮派":
                    task = new 帮派Task();
                    break;
                case "挖图":
                    task = new 挖图Task();
                    break;
                case "师门":
                    task = new 师门Task();
                    break;
                case "深渊":
                    task = new 秘境Task();
                    break;
                case "运镖":
                    task = new 运镖Task();
                    break;
                default:
                    {

                    }
                    break;

            }
            if (task == null)
            {
                return null;
            }
            task.api = this;
            return task;
        }
    }
}
